package com.laolang.gongda.bookshop.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.laolang.gongda.bookshop.domain.User;
import com.laolang.gongda.bookshop.service.UserService;

@Controller
@RequestMapping("user")
public class UserController {
	
	Logger log = LoggerFactory.getLogger("infoLog");
	
	@Autowired
	private UserService userService;
	
	@RequestMapping(value="status",method=RequestMethod.POST,produces="text/html")
	public String currentStatus( User user, Model model ){
		log.info("查看状态");
		User u = userService.find(1);
		model.addAttribute("user", u);
		return "user/userstatus";
	}

}
